<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

namespace App\Controller;

use Hyperf\HttpServer\Annotation\Middleware;
use App\Middleware\JTAuthMiddleware;
use App\Middleware\CorsMiddleware;
use App\Service\Auth\AuthQuickService;
use App\Service\Auth\AuthSocialService;
use App\Service\Auth\BindPhoneService;
use App\Service\Auth\BindSocialService;
use App\Service\Auth\CancelInfoService;
use App\Service\Auth\CaptchaCheckService;
use App\Service\Auth\CaptchaGetService;
use App\Service\Auth\FixProfileService;
use App\Service\Auth\LogoutService;
use App\Service\Auth\PhoneCheckService;
use App\Service\Auth\AliVerfyResultService;
use App\Service\Auth\AliVerfyTokenService;
use App\Service\Auth\ManualVerfyService;
use App\Service\Auth\v1_1_0\FixMaleProfileService;
use App\Service\Auth\v1_1_8\CancelApplyService;
use App\Service\Auth\v1_1_8\CancelInfoService as V1_1_8CancelInfoService;
use App\Service\Auth\v1_3_3\PickNickService;
use App\Service\Auth\v1_3_4\SocialBindInfoService;
use App\Service\Auth\v1_3_4\UnbindSocialService;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\HttpServer\Annotation\Controller;
use App\Service\Auth\AppStandardService;

/**
 * @Controller(prefix="auth")
 */
class AuthController extends AbstractController
{
    /**
     * 获取验证码
     * @RequestMapping(path="captcha/get", methods="post")
     * @Middleware(CorsMiddleware::class)
     */
    public function captcha_get(CaptchaGetService $service)
    {
        return $service->response();
    }

    /**
     * 检测验证码，并登录（或注册）
     * @RequestMapping(path="captcha/check", methods="post")
     * @Middleware(CorsMiddleware::class)
     */
    public function captcha_check(CaptchaCheckService $service)
    {
        return $service->response();
    }

    /**
     * 检测验证码并登录（或注册）
     * @RequestMapping(path="captcha/check_hv", methods="post")
     * @Middleware(CorsMiddleware::class)
     */
    public function captcha_check_hv(CaptchaCheckService $service)
    {
        return $service->response();
    }

    /**
     * 完善资料
     * @RequestMapping(path="profile/fix", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function profile_fix(FixProfileService $service)
    {
        return $service->response();
    }

    /**
     * 男用户注册完善资料
     * @RequestMapping(path="v1_1_0/profile/fix_male", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function profile_fix_male(FixMaleProfileService $service)
    {
        return $service->response();
    }

    /**
     * 第三方注册
     * @RequestMapping(path="social", methods="post")
     */
    public function social(AuthSocialService $service)
    {
        return $service->response();
    }

    /**
     * 手机号一键登录（注册）
     * @RequestMapping(path="quick", methods="post")
     */
    public function quick(AuthQuickService $service)
    {
        return $service->response();
    }

    /**
     * 绑定手机号
     * @RequestMapping(path="phone/bind", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function bind_phone(BindPhoneService $service)
    {
        return $service->response();
    }

    /**
     * 绑定qq和微信
     * @RequestMapping(path="social/bind", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function bind_social(BindSocialService $service)
    {
        return $service->response();
    }


    /**
     * 解绑qq和微信
     * @RequestMapping(path="social/unbind", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function unbind_social(UnbindSocialService $service)
    {
        return $service->response();
    }

    /**
     * 第三方账号绑定信息
     * @RequestMapping(path="social/bind_info", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function socail_bind_info(SocialBindInfoService $service)
    {
        return $service->response();
    }

    /**
     * 退出登录
     * @RequestMapping(path="logout", methods="post")
     */
    public function logout(LogoutService $service)
    {
        return $service->response();
    }

    /**
     * 注销提示信息
     * @RequestMapping(path="cancel_info", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function cancel_info(CancelInfoService $service)
    {
        return $service->response();
    }

    /**
     * 手机号检测
     * @RequestMapping(path="phone/check", methods="post")
     */
    public function check_phone(PhoneCheckService $service)
    {
        return $service->response();
    }

    /**
     * 阿里云-认证token获取
     * @RequestMapping(path="aliyun/verfy_token", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function aliyun_verfy_token(AliVerfyTokenService $service)
    {
        return $service->response();
    }

    /**
     * 阿里云-认证结果
     * @RequestMapping(path="aliyun/verfy_result", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function aliyun_verfy_result(AliVerfyResultService $service)
    {
        return $service->response();
    }

    /**
     * 人工提交认证
     * @RequestMapping(path="verfy_manual", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function verfy_manual(ManualVerfyService $service)
    {
        return $service->response();
    }

    /**
     * 注销页面信息
     * @RequestMapping(path="v1_1_8/cancel_info", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function v1_1_8_cancel_info(V1_1_8CancelInfoService $service)
    {
        return $service->response();
    }

    /**
     * 注销申请提交
     * @RequestMapping(path="v1_1_8/cancel_apply", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function cancel_apply(CancelApplyService $service)
    {
        return $service->response();
    }

    /**
     * 随机获取昵称
     * @RequestMapping(path="v1_3_3/pick_nick", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function pick_nick(PickNickService $service)
    {
        return $service->response();
    }
    /**
     * 隐私政策
     * @RequestMapping(path="get_policy", methods="post")
     */
    public function get_policy(AppStandardService $service)
    {
        return $service->response();
    }
}
